package plagiarism;


import java.util.ArrayList;
import java.util.Scanner;
import java.lang.Exception;

public class ScanManager extends Object
{
	public void scan(ArrayList<String[]> list, String[] article_names)
	{
		System.out.println("Now is ScanManager");
		try
		{
			Scanner scan_no[] = new Scanner[IO.num];
			ArrayList<String> now_list = new ArrayList<String>();
			for(int i=0; i<IO.num; i++)
			{
				scan_no[i] = new Scanner(filemanager.getArticles(i));
			}
			
			for(int i=0; i<IO.num; i++)
			{
				while(scan_no[i].hasNext())
				{
					String temp = scan_no[i].next();
					now_list.add(temp);
				}
				String[] array = now_list.toArray(new String[now_list.size()]);
				list.add(array);
				
				now_list.clear();
			}
		}
		catch(Exception e)
		{
			System.out.println(e);
		}
	}

	public ScanManager(FileManager filemanager)
	{
		this.filemanager = filemanager;
	}
	
	private FileManager filemanager;
}

